home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
DOC201.ARJ
/
DOC.MAN
< prev
Wrap
Text File
|
1992-04-02
|
22KB
|
611 lines
DOC
Source Code Documenter for Clipper 5.0x
Version 2.00
Copyright (C) 1991
Clarity Computer Consultants
1831 - 13th St.
Moline, IL 61265
(309) 797-0906
1
OVERVIEW
DOC, the Source Code Documenter for Clipper 5.0x code, will read
your Clipper source code files and rewrite them into another
directory, indenting the code to show program control structures,
inserting a file header listing all the functions and procedures
in the file and a function header preceding each function and
procedure listing all the other functions which call or are
called by this function, lists the parameters and provides space
for the programmer to insert comments for each parameter and to
state the function's purpose, output and assumptions. These
programmer comments in the headers are supported by DOC in that
each time DOC documents your source code it saves any existing
comments and reinserts them in the new header. DOC saves the
name of the parameter with the parameter comments so that even if
the parameter order has been changed DOC will keep the comment
with the correct parameter.
DOC can also send your source code files to the printer, or print
to disk. The printed source code files have page headers in-
serted at the top of each page and a Table of Contents, listing
the page on which each function and parameter starts. DOC can
optionally also insert line numbers in printed source code files.
DOC will optionally also create an action diagram for each source
code file with lines marking the program control structures. The
printed action diagrams also have page headers, Table of Contents
and, optionally, line numbers inserted.
DOC can create a list of source code files to be documented
automatically from a make file or any ASCII text file in which
the names of the source code files appear. Clipper library
functions and other functions can be listed in KEY files, identi-
fying them to DOC. For each KEY file you can tell DOC whether or
not the functions in that library should be listed in the headers
and reports.
DOC optionally also creates a Function and Procedure Report
listing each function and procedure in the source code files in
either alphabetical or order read or both. Each function and
procedure is listed with a list of functions called, the func-
tion's parameters and comments and the other programmers com-
ments.
DOC creates a Index and a Table of Contents document listing all
the functions and procedures in the system with the page number
and name of the name of the source code file for each. The Index
document lists the functions and procedures in alphabetical order
and the Table of Contents lists them in the order read.
DOC, in conjunction with a Norton guide compiler and linker such
as those that are supplied with Expert Help, can create a Norton
Guide database for all the functions and procedures in the system
2
using the parameter list for the syntax and the programmer's
comments for the text. DOC creates the NGC compile file, the NGL
link file and a batch file which, when run, automatically com-
piles and links the guide.
Running DOC
If the file DOC.EXE resides in a directory in your path you can
invoke DOC from any DOS prompt. Just type
DOC <ENTER>
To force monochrome screen colors on a computer which returns .T.
to the ISCOLOR() function you would type
DOC B/W <ENTER>
When DOC loads it displays an title page and then the Enter
System Variables Screen.
Enter System Variables
MAKE FILE AND SOURCE CODE PATH
The Source Code Path is the directory in which DOC looks for
source code files which are listed without a path, where it looks
for the make file and in which it saves and from which it re-
trieves its System Data. If most of the source code files and
make file for each separate application to be documented are in
their own separate directories DOC can be run with the minimum of
hassle, but DOC has enough flexibility to work with any directory
structure. If this field is left blank the current DOS directory
is the Source Code Path.
SYSTEM DATA FILE NAME
The default name for the file in which DOC saves the System Data
is CONFIG.DOC. If there already is a file with this name or you
want more than one configuration of DOC with the same Source Code
Path you can specify another name.
MAKE FILE NAME
Type in the name of the make file, or ASCII text file, if you
will want DOC to create a list of files to document for you. The
file must be in the Source Code directory and if no extension is
specified an extension of RMK is assumed. If the file name has
no extension put a period at the end of the name.
NAME OF APPLICATION, AUTHOR and COPYRIGHT HOLDER
The data typed in these 3 fields will be used in the headers of
all output files and reports.
OUTPUT FILE PATH
3
Specify a directory where the output source code files, action
diagrams, reports and print to disk files will be created. This
must be different than the Source Code Path or other directories
where input source code files reside or there will be name con-
flicts between the input and output files.
KEY FILE PATH
The drive and directory where DOC expects to find the key files
specified in the key file list.
The Main Menu Screen
FILES
System Data <F1>
Pressing F1 brings up the System Data screen again.
Key File List <F8>
Selecting this option places you in the Key File Names and Doc
Names screen. Type in the names of your key files including
extension. DOC will assume these files are in the key file
directory specified on the System Data screen. If you leave the
Doc Name column blank the functions listed in that key file will
be ignored by DOC. If you type in a Doc Name the functions in
that key file will included in the file headers and reports and
will be listed as being "from" that Doc Name. Press ENTER to be
editing on the current line. Press the down arrow key to add a
new line. Press the ESC key when done.
From Make File <F2>
Selecting this option causes DOC to read the make file and ex-
tract the names of all files with an extension of PRG or SCR
which it finds and creates the List of Files to be Documented. If
you do not have a file which lists your source code files or you
want to document source code files with non-standard extensions
just type in your list of files using the Edit File List proce-
dure.
Edit File List <F3>
When you select this option you can edit the List of Files to be
Documented. To add new source code file names use the down arrow
key to move to a blank line and type in the name. Press the DEL
key to delete an existing name. Be sure to specify the path for
any source code files which are not in the Source Code Path drive
and directory. Press ESC key when done.
4
OUTPUT
Source Code <F4>
When this option is selected a screen pops up with the following
options. On questions with non-numeric answers toggle through
the options by pressing any keys other than the arrow keys. Use
the up and down arrow keys to move the cursor.
9 Write SourceCode files to output path YES/NO
If YES, each source code file in the File List is rewritten to
the Output Directory with headers inserted and indented.
Print Source Code files YES/NO
If YES, each source code file is sent to a printer port or a disk
file with headers inserted, indented, page breaks and headers and
a Table of Contents.
Send Printed Source Code to LPT1/LPT2/LPT3/COM1/COM2/FILE
If FILE, the Source Code files are printed to a file with an
extension of *.PRN in the output directory. Otherwise the print-
ed source code is sent to the printer port selected.
Line numbers in printed source code YES/NO
If YES, line numbers are inserted at the beginning of each line
of the printed file.
Write action diagrams to output path YES/NO
If YES, each source code file is rewritten to the Output Directo-
ry with an extension .ACT, headers, indenting and lines marking
the program control structures.
Print action diagrams YES/NO
If YES, each action diagrams is sent to a printer port or printed
to disk with page breaks, headers and a Table of Contents.
Send Printed Action diagrams to LPT1/LPT2/.../COM2/FILE
If FILE, the action diagrams are printed to files in the output
directory with an extension of .APN. Otherwise they are sent to
the selected printer port.
Line numbers in printed action diagrams YES/NO
If YES, line numbers are inserted at the beginning of each line
in the printed action diagrams.
Use graphics in action diagrams YES/NO
If YES, IBM upper ASCII box-drawing characters are used to mark
the control structures in action diagrams. If your printer
cannot print these characters properly select NO.
Final page eject in printed output YES/NO
If NO, the page eject on the final page of printed output is
omitted. This avoids extra blank pages when using utilities such
as LJBOOK after printing to disk.
Spaces to indent comment lines [Numeric input]
Number of spaces to indent file and function headers created by
5
DOC. If you want only FUNCTION and PROCEDURE declaration lines
to start in Column 0 in your source code enter a number other
than 0 here.
Indent #if, #else, #endif YES/NO
If YES, #if #else and #endif are treated the same as IF, ELSE and
ENDIF in terms of indenting and in the action diagrams. If NO,
they are not treated as program control structures.
Number of char/line in printer output [Numeric input]
Number of characters per line your printer can handle. Lines
longer than this a counted as 2 lines in determining page breaks.
Number of spaces to indent per level [Numeric input]
Number of spaces to indent each control level. Three seems to be
a standard. I prefer the look of 2, personally. Entering 0
tells DOC to retain the original indenting.
(O)verwrite, (A)bort, enter (N)ew name or
(R)ename existing file if already exists O/A/N/R
Determines what DOC does when it is about to create a file in the
Output directory and it discovers a file with the same name
already there. If O, it ignores the problem and overwrites the
existing file. (Careful! If you put O here and make the Output
directory and the Source Code directory the same your original
source files will be over-written.) If A, it aborts processing.
If N, it prompts the user for a new name for the file it is about
to create. If R, it prompts the user for a new name for the
existing file.
Reports <F5>
When this option is selected the user is presented with a screen
containing the following options:
Send printed reports to LPT1/LPT2/LPT3/COM1/COM2/FILE
Determines where the reports are sent.
Create Data Directory and CH files YES/NO
If YES, creates a Data Directory data base and a report for all
the databases and indexes it finds in the Source Code directory
which are referred to the source code. It also creates a CH
include file with some handy preprocessor defines for each data-
base.
Create Index and TOC listing of functions YES/NO
If YES, creates reports listing every function and procedure, the
source code file name in which it was found and the page number
in the source code where it starts. (If neither source code
files or action diagrams are printed no page numbers are created
and all page numbers will be 0.) The Index and Table of Contents
are identical except for the order in which the functions appear.
Create Function report in read order YES/NO
This is a report which lists all the functions and procedures in
the application along with all the information from its header,
6
source code, line number and source code file name.
Create Function report in alpha order YES/NO
Same as above except the functions and procedures are listed in
alphabetical order.
Create Norton Guide from headers info YES/NO
If YES, the Norton guide compile file, linker file and a batch
file are created in the Output directory which, along with a
Norton Guide compiler and linker, such as those provided with
Expert Help, can create a Norton Guide for all the procedures and
functions in the application.
Command to invoke Norton Guide compiler [character input]
Type in the DOS command to invoke the Norton Guide compiler. If
your Norton Guide compiler is in a directory in your DOS path
this would usually be "NGC". Otherwise you would need to include
the path, ie "D:\EH\NGC".
Command to invoke Norton Guide linker [character input]
Type in the DOS command to invoke the Norton Guide linker, ie
"D:\EH\NGML".
WRITE
F6 - Read Configuration
When you select this option DOC tries to read in a previously
created System Data File from the currently specified Source Code
Directory. If another name was not specified in the System Data
it looks for a file called "CONFIG.DOC". If it finds the file it
reads it in, over-writing any existing entries. The system data
includes all user input including the data in the System Data
screen, Output Data screen, Source Code File List and Key File
List.
F7 - Write Configuration
When you select this option DOC saves all the System Data to a
file in the current Source Code directory with the name
"CONFIG.DOC" or other name as specified by the System Data File
name in System Data screen.
GO
F9 - Start Documenting
When the F9 key is pressed DOC starts to work using the current
settings. You can abort by pressing the ESC key.
EXIT
Alt-G - Go Back
Go back to the Main Menu Screen. Don't exit.
F10 - Quit
Exits to DOS without doing anything.
7
The DOCPATH Environmental Variable
DOC creates a number of temporary databases while it is process-
ing which it erases before terminating. DOC looks for an envi-
ronmental variable named DocPath. If found it creates its tempo-
rary files in the drive and directory specified by this variable.
If there is no DocPath in the environment it looks for a variable
named TEMP and uses the drive and directory specified by it. If
it finds neither it uses the current DOS directory for its tempo-
rary files.
If you have a RAM drive that is big enough (2 or 3 MBytes should
be big enough if you are not documenting a HUGE application) set
DocPath to it. Otherwise, it would be good to specify a directo-
ry where you have no permanent files to avoid any possibility of
a name collision.
Support for SNAPCODE Comments
DOC will document database and index files if their names are
used directly in USE and INDEX statements. If the names of the
files are passed in variables, however, DOC will not know to
include them unless you use a SNAPCODE comment. (Walter Kemmerer
suggested that DOC support SNAPCODE comments as a convenience to
the Clipper community.) A SNAPCODE comment is a line starting
with an asterisk and then the word SNAPCODE. Everything in the
line following the word SNAPCODE will be processed by DOC as
though it were code.
For example, if you have a generic function to open your
databases you might want to add a SNAPCODE comment following each
place in the code where it is called like this:
OpenDBFandNTX( "Customer", "CustIndx", cIndexExp )
* SNAPCODE USE Customer INDEX CustIndx
Another place to use SNAPCODE comments would be where a function
is called indirectly so that DOC knows that a function is being
called from the current function. For example:
ACHOICE( nT, nL, nB, nR, acMenu, , "UserFunc" )
* SNAPCODE UserFunc()
8
Programmer's Comments in the Headers
Doc creates a place in the file header and in each function
header for programmer's comments. Each time DOC documents a
source code file existing header comments are saved and reinsert-
ed into the newly created headers. These comments also appear in
the Function Report. Future versions of DOC will use these
comments to help create Norton Guides databases.
There are a couple of rules you must follow when inserting your
comments in the headers so that DOC can recognize them. DOC uses
the following strings to recognize the beginning and ending point
of your comments. Do not delete any spaces or otherwise alter
these strings in the headers or DOC will not be able to find your
comments.
*: Comments :
*: Procs & Funcs:
*! Purpose :
*! In :
*! Out :
*! Assumes :
*!************
You can create multi-line comments by inserting lines. Just be
sure to start each new line in the header with a *: (file header)
or *! (function header).
9
Registering DOC
Thank you for taking a look at DOC. If you have any questions
address them to David Barrett, or Hugh D. Barrett as I am known
on NANFORUM, at
CIS
72037,105
telephone
(309) 797-0906 evenings & weekends
mail
Clarity Computer Consultants
1831 13th Street
Moline, IL 61265
U.S.A.
The registration fee is $35 or whatever you feel it is worth.
Send the registration fee to the above address. If you are
registered I will treat any suggestions you have about the pro-
gram with great seriousness and try to solve any problems you
have promptly. If you are not registered I reserve the right to
treat your problems and suggestions any way I feel like.
10